package edu.ccut.saturn.studio.wfg.wfgmodel;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

import edu.ccut.saturn.studio.core.util.xml.SaturnW3CUtil;
import edu.ccut.saturn.studio.wfg.model.Shape;
import edu.ccut.saturn.studio.wfg.utils.RunTime;

public class UsersAttribute implements SaturnAttribute{
	
	private String id = "";
	
	private String name = "";
	
	private String type = "";
	
	public UsersAttribute(UsersAttribute usersAttribute){
		this.id = usersAttribute.id;
		this.name = usersAttribute.name;
		this.type = usersAttribute.type;
	}
	
	public UsersAttribute(){
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Node creatNode(Document doc, String nodeName) {
		Node userNode = doc.createElement(nodeName);
		SaturnW3CUtil.createAttribute(userNode, SaturnName.KEY_NODE_NAME_ID,RunTime.getValue(this, SaturnName.METHOD_GETID));
		SaturnW3CUtil.createAttribute(userNode, Shape.KEY_NODE_NAME,RunTime.getValue(this, SaturnName.METHOD_GETNAME));
		SaturnW3CUtil.createAttribute(userNode, SaturnName.XML_TYPE,RunTime.getValue(this, SaturnName.METHOD_GETTYPE));
		return userNode;
	}
}
